import  urllib.request
import lxml
import lxml.etree
def  download(url):
    headers={"User-Agent":"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0);"}
    request = urllib.request.Request(url, headers=headers)  # 请求，修改，模拟http.
    data = urllib.request.urlopen(request).read()  # 打开请求，抓取数据
    #data=data.decode("gbk").encode("utf-8")#乱码
    mytree=lxml.etree.HTML(data)
    datalist=mytree.xpath("//ul[@class=\"piclist longList\"]/li/div[@class=\"f18 mb20\"]/text()")
    for  linedata in datalist:
        print(linedata)



download("https://www.neihanba.com/dz/")